#!/bin/bash

#set GOOS=linux
#set GOARCH=amd64
ssh -i id_rsa root@192.168.1.145 "/servers/stop.sh"

GOOS=linux GOARCH=amd64 go build -o ../bin_test/api/api_srv ../modules/api/main.go
echo "go build -o ../bin_test/api/api_srv"

GOOS=linux GOARCH=amd64 go build -o ../bin_test/activity/activity_srv ../modules/activity/main.go
echo "go build -o ../bin_test/api/activity_srv"

#GOOS=linux GOARCH=amd64 go build -o ../bin_test/building/building_srv ../modules/building/main.go
#echo "go build -o ../bin_test/api/building_srv"

GOOS=linux GOARCH=amd64 go build -o ../bin_test/captain/captain_srv ../modules/captain/main.go
echo "go build -o ../bin_test/api/captain_srv"

GOOS=linux GOARCH=amd64 go build -o ../bin_test/chat/chat_srv ../modules/chat/main.go
echo "go build -o ../bin_test/api/chat_srv"

GOOS=linux GOARCH=amd64 go build -o ../bin_test/conquer/conquer_srv ../modules/conquer/main.go
echo "go build -o ../bin_test/api/conquer_srv"

GOOS=linux GOARCH=amd64 go build -o ../bin_test/guild/guild_srv ../modules/guild/main.go
echo "go build -o ../bin_test/api/guild_srv"

GOOS=linux GOARCH=amd64 go build -o ../bin_test/item/item_srv ../modules/item/main.go
echo "go build -o ../bin_test/api/item_srv"

GOOS=linux GOARCH=amd64 go build -o ../bin_test/mail/mail_srv ../modules/mail/main.go
echo "go build -o ../bin_test/api/mail_srv"

GOOS=linux GOARCH=amd64 go build -o ../bin_test/money/money_srv ../modules/money/main.go
echo "go build -o ../bin_test/api/money_srv"

GOOS=linux GOARCH=amd64 go build -o ../bin_test/ranking/ranking_srv ../modules/ranking/main.go
echo "go build -o ../bin_test/api/ranking_srv"

GOOS=linux GOARCH=amd64 go build -o ../bin_test/ring/ring_srv ../modules/ring/main.go
echo "go build -o ../bin_test/api/ring_srv"

GOOS=linux GOARCH=amd64 go build -o ../bin_test/role/role_srv ../modules/role/main.go
echo "go build -o ../bin_test/api/role_srv"

GOOS=linux GOARCH=amd64 go build -o ../bin_test/world_boss/world_boss_srv ../modules/world_boss/main.go
echo "go build -o ../bin_test/api/world_boss_srv"

GOOS=linux GOARCH=amd64 go build -o ../bin_test/pay/pay_srv ../modules/pay/main.go
echo "go build -o ../bin_test/api/pay_srv"

scp -i id_rsa -r ../bin_test/* root@192.168.1.145:/servers
#ssh -i id_rsa root@192.168.1.145 "/servers/restart.sh"